﻿using System;

class PositiveOrNegative
{
    static void Main()
    {
        /*Write a program that shows the sign (+ or -) of the product
         * of three real numbers without calculating it. Use a sequence of if statements*/

        Console.WriteLine("Enter three numbers.");
        Console.Write("Enter first number: ");
        double firstNumber = double.Parse(Console.ReadLine());
        Console.Write("Enter second number: ");
        double secondNumber = double.Parse(Console.ReadLine());
        Console.Write("Enter third number: ");
        double thirdNumber = double.Parse(Console.ReadLine());
                   
        if (firstNumber == 0 || secondNumber == 0 || thirdNumber == 0)
        {
            Console.WriteLine("The product of the three numbers is 0");
        }        
        else if (((firstNumber > 0) ^ (secondNumber > 0)) && (thirdNumber < 0))
        {
            Console.WriteLine("The product of the three numbers is positive");
        }
        else if (!((firstNumber > 0) ^ (secondNumber > 0)) && (thirdNumber > 0)) 
        {
            Console.WriteLine("The product of the three numbers is positive");
        }
        else if (!((firstNumber > 0) ^ (secondNumber > 0)) && (thirdNumber < 0)) 
        {
            Console.WriteLine("The product of the three numbers is negative");
        }
        else if (((firstNumber > 0) ^ (secondNumber > 0)) && (thirdNumber > 0)) 
        {
            Console.WriteLine("The product of the three numbers is negative");
        }
    }
}

